package contents

import (
	"yizhuoyan/go-study/pdfgo/raw/objects/basicobject"
	"yizhuoyan/go-study/pdfgo/raw/objects/streamobject"
)

type PageContentStreams struct {
	page      *Page
	streamObj streamobject.StreamObject
}

func (this PageContentStreams) ParseFrom(page *Page, ref *basicobject.IndirectObjectReference) error {
	rst, err := page.locator.LoadIndirectObject(ref)
	if err != nil {
		return err
	}
	this.streamObj = rst.MustGetStreamObject()
	this.page = page
	return nil
}
